package com.ziyun.erp.modules.facilitator.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ziyun.erp.modules.facilitator.dao.FacilitatorSellerRelationDao;
import com.ziyun.erp.modules.facilitator.entity.FacilitatorSellerRelationEntity;
import com.ziyun.erp.modules.facilitator.service.FacilitatorSellerRelationService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.common.utils.R;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("facilitatorSellerRelationService")
public class FacilitatorSellerRelationServiceImpl extends ServiceImpl<FacilitatorSellerRelationDao, FacilitatorSellerRelationEntity> implements FacilitatorSellerRelationService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<FacilitatorSellerRelationEntity> page = this.selectPage(
                new Query<FacilitatorSellerRelationEntity>(params).getPage(),
                new EntityWrapper<FacilitatorSellerRelationEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public R updateDisabled(Integer parentUserId) {
        this.baseMapper.updateDisabled(parentUserId);
        return R.ok();
    }

    @Override
    public void updateByMap(Map<String, Object> facilitatorMap, Integer id) {
        baseMapper.updateByMap(facilitatorMap, id);
    }

}
